#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>


int main (void)
{
	char *ip1 = "192.168.1.1";
	char *ip2 = "192.168.1.4";
	struct in_addr addr1,addr2;
	
	if (!inet_aton(ip1,&addr1)) 
	{
		printf("tran addr1 error\n");
		exit(1);
	}
	
	printf("ip1 = %d \n",addr1.s_addr);

	
	
	if (!inet_aton(ip2,&addr2)) 
	{
		printf("tran addr2 error\n");
		exit(1);
	}
	
	printf("ip2 = %d \n",addr2.s_addr);
	int buf1,buf2;
	buf1 = addr1.s_addr << 8;
	buf2 = addr2.s_addr << 8 ;
	printf("buf1 = %d buf2 = %d \n",buf1,buf2);
	if (buf1 == buf2 ) 
	{
		printf("true\n");
	}
	else printf("false\n");
	return 0;
	

}
